home *** CD-ROM | disk | FTP | other *** search
/ Ham Radio 2000 #2 / Ham Radio 2000 - Volume 2.iso / HAMV2 / MISC / HCAL-27 / QUAD.BAS (.txt) < prev    next >
Encoding:
GW-BASIC  |  1997-01-29  |  7.7 KB  |  258 lines

  1. 10  'QUAD - Quad Antenna - 17 MAY 94 - rev. 29 SEP 96
  2. 20  IF EX$=""THEN EX$="EXIT"
  3. 30  CLS:KEY OFF
  4. 40  COLOR 7,0,1
  5. 50  U$="###,###.###"
  6. 60  U1$="###,###.##"
  7. 70  U2$="###,###"
  8. 80  UL$=STRING$(80,205)
  9. 90  '
  10. 100  '.....start
  11. 110  CLS
  12. 120  COLOR 15,2
  13. 130  PRINT " QUAD ANTENNA DIMENSIONS";TAB(57);"by George Murphy VE3ERP ";
  14. 140  COLOR 1,0:PRINT STRING$(80,223);
  15. 150  COLOR 7,0
  16. 160  GOSUB 2070   'print text
  17. 170  PRINT UL$;
  18. 180  COLOR 0,7:LOCATE CSRLIN,22
  19. 190  PRINT " Press 1 to continue or 0 to EXIT....."
  20. 200  COLOR 7,0
  21. 210  Z$=INKEY$:IF Z$=""THEN 210
  22. 220  IF Z$="0"THEN CLS:RUN EX$
  23. 230  IF Z$="1"THEN 250
  24. 240  GOTO 210
  25. 250  VIEW PRINT 3 TO 24:CLS:VIEW PRINT:LOCATE 3
  26. 260  GOSUB 2380  'preface
  27. 270  PRINT UL$;
  28. 280  PRINT " Press number in < > to choose standard units of measure:"
  29. 290  PRINT UL$;
  30. 300  PRINT "  < 1 >  Metres"
  31. 310  PRINT "  < 2 >  Decimal feet"
  32. 320  PRINT "  < 3 >  Decimal inches"
  33. 330  Z$=INKEY$
  34. 340  IF Z$="1"THEN M=1:M$=" m. ":GOTO 380
  35. 350  IF Z$="2"THEN M=2:M$=" ft.":GOTO 380
  36. 360  IF Z$="3"THEN M=3:M$=" in.":GOTO 380
  37. 370  GOTO 330
  38. 380  VIEW PRINT 3 TO 24:CLS:VIEW PRINT:LOCATE 3
  39. 390  '
  40. 400  '.....frequency
  41. 410  INPUT " ENTER: Centre frequency of band (MHz)..............";F
  42. 420  LOCATE CSRLIN-1:IF F=0 THEN 410
  43. 430  PRINT "        Frequency of operation......................";USING U$;F;
  44. 440  PRINT " MHz"
  45. 450  '
  46. 460  '.....wavelength
  47. 470  WL=300/F                        'wavelength in free space (metres)
  48. 480  PRINT "        Wavelength of operation.....................";USING U$;WL;
  49. 490  PRINT " m."
  50. 500  PRINT
  51. 510  '
  52. 520  '.....long wire
  53. 530  LW=984*(1-0.025)/F               'length of full wave long wire (feet)
  54. 540  MT=LW*0.3048:IF M=1 THEN Y=MT    'wire length in metres
  55. 550  FT=LW:      IF M=2 THEN Y=FT    'wire length in feet
  56. 560  IN=FT*12:   IF M=3 THEN Y=IN    'wire length in inches
  57. 570  Y=INT(Y*10^3+0.5)/10^3
  58. 580  PRINT "        Length of a full wave long wire.............";USING U$;Y;
  59. 590  PRINT M$
  60. 600  '
  61. 610  '.....conductor size
  62. 620  PRINT
  63. 630  PRINT " Press number in < > to describe element material:
  64. 640  PRINT "   < 1 >  AWG gauge Wire"
  65. 650  PRINT "   < 2 >  Tubing"
  66. 660  PRINT "   < 3 >  Rod or non-AWG wire"
  67. 670  Z$=INKEY$
  68. 680  IF VAL(Z$)>=1 AND VAL(Z$)<=3 THEN 700
  69. 690  GOTO 670
  70. 700  LN=CSRLIN-5:VIEW PRINT LN TO 24:CLS:VIEW PRINT:LOCATE LN
  71. 710  IF M=1 THEN X$="(mm.)"ELSE X$="(in.)"
  72. 720  '
  73. 730  IF Z$="1"THEN 740 ELSE 820
  74. 740  INPUT " ENTER: AWG gauge of wire.......................AWG#";G
  75. 750  LOCATE CSRLIN-1:IF G=0 THEN 740
  76. 760  K=(0.46/0.005)^(1/39)
  77. 770  V=0.46/K^(G+3)
  78. 780  G$=STR$(G):G$=RIGHT$(G$,LEN(G$)-1)
  79. 790  C$="#"+G$+" AWG wire"
  80. 800  GOTO 940
  81. 810  '
  82. 820  IF Z$="2"THEN 830 ELSE 890
  83. 830  PRINT " ENTER: Diameter of tubing ";X$;"...................";:INPUT V
  84. 840  IF M=1 THEN V=V/25.4
  85. 850  LOCATE CSRLIN-1:IF V=0 THEN 830
  86. 860  C$=" tubing"
  87. 870  GOTO 940
  88. 880  '
  89. 890  PRINT " ENTER: Diameter of rod or wire ";X$;"..............";:INPUT V
  90. 900  IF M=1 THEN V=V/25.4
  91. 910  LOCATE CSRLIN-1:IF V=0 THEN 890
  92. 920  C$=" rod/wire"
  93. 930  '
  94. 940  IF M=1 THEN D=V*25.4 ELSE D=V       'D=conductor diameter in inches
  95. 950  IF M=1 THEN X$=" mm." ELSE X$=" in."
  96. 960  PRINT "        Diameter of conductor.......................";USING U$;D;
  97. 970  PRINT X$;C$;
  98. 980  '
  99. 990  '.....correction factors
  100. 1000  CD=IN/D:IF M=1 THEN CD=MT*10^3/D
  101. 1010  PRINT "        Long Wire length-to-diameter ratio..........";USING U1$;CD;
  102. 1020  PRINT ":1"
  103. 1030  SF=(LOG(CD/6*2.54))/LOG(10)*4.66
  104. 1040  PRINT "        Shape factor................................";USING U$;SF
  105. 1050  CF=1+0.4/SF+3/SF^2
  106. 1060  CF=INT(CF*10^3+0.5)/10^3
  107. 1070  PRINT "        Long-Wire-to-loop correction factor.........";USING U$;CF
  108. 1080  '
  109. 1090  '.....driven element
  110. 1100  IF M=1 THEN DE=CF*MT    'metres
  111. 1110  IF M=2 THEN DE=CF*FT    'feet
  112. 1120  IF M=3 THEN DE=CF*IN    'inches
  113. 1130  PRINT
  114. 1140  PRINT "        DRIVEN element, loop circumference..........";USING U$;DE;
  115. 1150  PRINT M$
  116. 1160  DS=DE/4        'one side of square
  117. 1170  PRINT "        DRIVEN element, each side...................";USING U$;DS;
  118. 1180  PRINT M$
  119. 1190  DD=SQR(2*DS^2)
  120. 1200  PRINT "        DRIVEN element diagonal.....................";USING U$;DD;
  121. 1210  PRINT M$
  122. 1220  PRINT "                     RENUM diagonal.....................";USING U$;DD/2;
  123. 1230  PRINT M$
  124. 1240  '
  125. 1250  '.....reflector element
  126. 1260  IF F>30 THEN R=1.05 ELSE R=1.025
  127. 1270  RE=DE*R
  128. 1280  PRINT
  129. 1290  PRINT "        REFLECTOR element, loop circumference.......";USING U$;RE;
  130. 1300  PRINT M$
  131. 1310  RS=RE/4        'one side of square
  132. 1320  PRINT "        REFLECTOR element, each side................";USING U$;RS;
  133. 1330  PRINT M$
  134. 1340  RD=SQR(2*RS^2)
  135. 1350  PRINT "        REFLECTOR element diagonal..................";USING U$;RD;
  136. 1360  PRINT M$
  137. 1370  PRINT "                        RENUM diagonal..................";USING U$;RD/2;
  138. 1380  PRINT M$
  139. 1390  '
  140. 1400  '.....spacing
  141. 1410  A=WL*0.15:B=WL*0.25                     'min.& max.spacing in metres
  142. 1420  IF M=1 THEN MIN=A:MAX=B               'metres
  143. 1430  IF M=2 THEN MIN=A/0.3048:MAX=B/0.3048   'feet
  144. 1440  IF M=3 THEN MIN=A/0.0254:MAX=B/0.0254   'inches
  145. 1450  PRINT
  146. 1460  PRINT "        Minimum spacing between elements............";USING U1$;MIN;
  147. 1470  PRINT M$
  148. 1480  PRINT "        Maximum spacing between elements............";USING U1$;MAX;
  149. 1490  PRINT M$
  150. 1500  GOSUB 2450
  151. 1510  '
  152. 1520  '.....diagram
  153. 1530  VIEW PRINT 3 TO 24:CLS:VIEW PRINT
  154. 1540  LOCATE 4:J=13   'column
  155. 1550  COLOR 0,7
  156. 1560  LOCATE ,J:PRINT"                                                        "
  157. 1570  LOCATE ,J:PRINT"  CALLDEFSNGSOUNDSOUNDSOUNDSOUND D SOUNDSOUNDSOUNDSOUNDDEFDBLCALL     CALLDEFSNGSOUNDSOUNDSOUNDSOUND R SOUNDSOUNDSOUNDSOUNDDEFDBLCALL     CALLDEFSNGSOUNDSOUNDSOUND S SOUNDSOUNDSOUNDDEFDBLCALL "
  158. 1580  LOCATE ,J:PRINT"  CALL  each side  CALL     CALL  each side  CALL     CALL  Element  CALL "
  159. 1590  LOCATE ,J:PRINT" dVARPTRSOUNDSOUNDSOUNDSOUNDSOUNDSOUNDSOUNDSOUNDSOUNDSOUNDSOUNDSOUNDSOUNDCOLOR    rVARPTRSOUNDSOUNDSOUNDSOUNDSOUNDSOUNDSOUNDSOUNDSOUNDSOUNDSOUNDSOUNDSOUNDCOLOR        Spacing    "
  160. 1600  LOCATE ,J:PRINT"  CALL             CALL     CALL             CALL     CALL           CALL "
  161. 1610  LOCATE ,J:PRINT"  CALL   Driven    CALL     CALL  Reflector  CALL     CALLDEFSNGdriven    CALL "
  162. 1620  LOCATE ,J:PRINT"  CALL             CALL     CALL             CALL     PSETTHENTHENTHENTHENBoomTHENTHENTHEN<0xB5!> "
  163. 1630  LOCATE ,J:PRINT"  CALL   Element   CALL     CALL   Element   CALL     CALL reflectorDEFDBLCALL "
  164. 1640  LOCATE ,J:PRINT"  CALL             CALL     CALL             CALL     CALL           CALL "
  165. 1650  LOCATE ,J:PRINT"  CLSSOUNDSOUNDSOUNDSOUNDSOUNDCOLOR VARPTRSOUNDSOUNDSOUNDSOUNDSOUND'd    CLSSOUNDSOUNDSOUNDSOUNDSOUNDSOUNDSOUNDSOUNDSOUNDSOUNDSOUNDSOUNDSOUND'r                  "
  166. 1660  LOCATE ,J:PRINT"                                                        "
  167. 1670  COLOR 7,0
  168. 1680  PRINT
  169. 1690  PRINT TAB(12)" Configuration shown is for horizontal polarity."
  170. 1700  PRINT TAB(12)" Do you want to configure for vertical polarity?   (y/n)"
  171. 1710  Z$=INKEY$
  172. 1720  IF Z$="y"THEN P$="VERTICALLY":GOTO 1750
  173. 1730  IF Z$="n"THEN P$="HORIZONTALLY":GOTO 1820
  174. 1740  GOTO 1710
  175. 1750  COLOR 0,7:LOCATE 9
  176. 1760  LOCATE ,J+1:PRINT "SOUND'"
  177. 1770  LOCATE ,J+1:PRINT "  "
  178. 1780  LOCATE ,J+1:PRINT "SOUNDCOLOR"
  179. 1790  LOCATE 13,J+8:PRINT "SOUNDSOUNDSOUND"
  180. 1800  COLOR 7,0
  181. 1810  '
  182. 1820  '.....complete screen printing
  183. 1830  VIEW PRINT 16 TO 24:CLS:VIEW PRINT:LOCATE 3
  184. 1840  P$=P$+" POLARIZED 2-ELEMENT QUAD ANTENNA for"+STR$(F)+" MHz"
  185. 1850  PRINT TAB(J)P$
  186. 1860  T=24
  187. 1870  LOCATE 16
  188. 1880  '
  189. 1890  PRINT TAB(T)"D.... =";USING U$;DS;:PRINT M$;" (loop =";
  190. 1900  LD=INT(DE*100+0.5)/100
  191. 1910  PRINT LD;:PRINT RIGHT$(M$,3);C$;")"
  192. 1920  PRINT TAB(T-9)"diagonal d-d.. =";USING U$;DD;:PRINT M$
  193. 1930  '
  194. 1940  PRINT TAB(T)"R.... =";USING U$;RS;:PRINT M$;" (loop =";
  195. 1950  LR=INT(RE*100+0.5)/100
  196. 1960  PRINT LR;RIGHT$(M$,3);C$;")"
  197. 1970  PRINT TAB(T-9)"diagonal r-r.. =";USING U$;RD;:PRINT M$
  198. 1980  '
  199. 1990  PRINT TAB(T)"S min.=";USING U1$;MIN;:PRINT M$
  200. 2000  PRINT TAB(T)"S max.=";USING U1$;MAX;:PRINT M$
  201. 2010  PRINT
  202. 2020  PRINT TAB(8);
  203. 2030  PRINT "Feed directly with 50-75- coax. Adjust spacing S for minimum SWR."
  204. 2040  GOSUB 2450
  205. 2050  GOTO 100   'start
  206. 2060  '
  207. 2070  '.....text
  208. 2080  T=(8)   'tab
  209. 2090  PRINT TAB(T);
  210. 2100  PRINT "Most published design data for quad antennas determine the length
  211. 2110  PRINT TAB(T);
  212. 2120  PRINT "of the elements by dividing an empirical number (usually in the
  213. 2130  PRINT TAB(T);
  214. 2140  PRINT "order of 1005 or thereabouts) by the frequency in MHz to arrive at
  215. 2150  PRINT TAB(T);
  216. 2160  PRINT "the length of the element in feet. Dimensions are not critical, as
  217. 2170  PRINT TAB(T);
  218. 2180  PRINT "the quad is relatively broad in frequency response, therefore
  219. 2190  PRINT TAB(T);
  220. 2200  PRINT "element lengths calculated by this method are usually adequate.
  221. 2210  PRINT TAB(T);
  222. 2220  PRINT
  223. 2230  PRINT TAB(T);
  224. 2240  PRINT "More precise dimensions can be calculated from raw data but seldom
  225. 2250  PRINT TAB(T);
  226. 2260  PRINT "are, due to the complex mathematics involved. This program utilizes
  227. 2270  PRINT TAB(T);
  228. 2280  PRINT "the mathematical rather than the empirical method of calculation to
  229. 2290  PRINT TAB(T);
  230. 2300  PRINT "design quads that do not require pruning and can be fed directly
  231. 2310  PRINT TAB(T);
  232. 2320  PRINT "with 50-75 ohm coax with no baluns, stubs or matching line sections.
  233. 2330  PRINT TAB(T);
  234. 2340  PRINT "Matching is accomplished simply by adjusting element spacing for
  235. 2350  PRINT TAB(T);
  236. 2360  PRINT "minimum SWR.
  237. 2370  RETURN
  238. 2380  '
  239. 2390  '.....preface
  240. 2400  OPEN"I",1,"\data\docfiles\antenna.doc"
  241. 2410  IF EOF(1)THEN 2430
  242. 2420  INPUT#1,NOTE$:PRINT "   ";NOTE$:GOTO 2410
  243. 2430  CLOSE:RETURN
  244. 2440  '
  245. 2450  'HARDCOPY
  246. 2460  GOSUB 2570:LOCATE 25,2:COLOR 14,6
  247. 2470  PRINT " Press 1 to print screen, 2 to print screen & ";
  248. 2480  PRINT "advance paper, or 3 to continue.";:COLOR 7,0
  249. 2490  Z$=INKEY$:IF Z$="3"THEN GOSUB 2570:RETURN
  250. 2500  IF Z$="1"OR Z$="2"THEN GOSUB 2570:GOTO 2520
  251. 2510  GOTO 2490
  252. 2520  FOR QX=1 TO 24:FOR QY=1 TO 80
  253. 2530  LPRINT CHR$(SCREEN(QX,QY));
  254. 2540  NEXT QY:NEXT QX
  255. 2550  IF Z$="2"THEN LPRINT CHR$(12)
  256. 2560  GOTO 2460
  257. 2570  LOCATE 25,1:PRINT STRING$(80,32);:RETURN
  258.